﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model.Db.Hr;


namespace HengTong.ViewModel.Person.SysPersonTrainExamVms
{
    public partial class SysPersonTrainExamTemplateVm : BaseTemplateVM
    {
        [Display(Name = "员工")]
        public ExcelPropety PersonExcel = ExcelPropety.CreateProperty<SysPersonTrainExam>(x => x.PersonId);
        [Display(Name = "培训批次")]
        public ExcelPropety PersonTrainBatcheExcel = ExcelPropety.CreateProperty<SysPersonTrainExam>(x => x.PersonTrainBatcheId);
        [Display(Name = "成绩")]
        public ExcelPropety ScoreExcel = ExcelPropety.CreateProperty<SysPersonTrainExam>(x => x.Score);

	    protected override void InitVM()
        {
            PersonExcel.DataType = ColumnDataType.ComboBox;
            PersonExcel.ListItems = DC.Set<SysPerson>().GetSelectListItems(Wtm, y => y.Name);
            PersonTrainBatcheExcel.DataType = ColumnDataType.ComboBox;
            PersonTrainBatcheExcel.ListItems = DC.Set<SysPersonTrainBatche>().GetSelectListItems(Wtm, y => y.TrainName);
        }

    }

    public class SysPersonTrainExamImportVm : BaseImportVM<SysPersonTrainExamTemplateVm, SysPersonTrainExam>
    {

    }

}
